import {http} from '@/utils/http/axios';

/**
 * @description: 角色列表
 */
export function getRoleList(params?: any) {
    return http.request({
            url: '/role/list',
            method: 'POST',
            params
        },
        {
            isTransformResponse: false,
        });
}

/**
 * 添加角色
 * @param params
 */
export function addRole(params?: any) {
    return http.request({
            url: '/role',
            method: 'PUT',
            params,
        },
        {
            isTransformResponse: false,
        });
}

/**
 * 编辑角色
 * @param params
 */
export function editRole(params?: any) {
    return http.request({
            url: '/role',
            method: 'POST',
            params,
        },
        {
            isTransformResponse: false,
        });
}

/**
 * 编辑角色
 * @param params
 */
export function editRoleMenu(params?: any) {
    return http.request({
            url: '/role/menu',
            method: 'POST',
            params,
        },
        {
            isTransformResponse: false,
        });
}

/**
 * 删除角色
 * @param id
 */
export function delRole(id: any) {
    return http.request({
            url: `/role/${id}`,
            method: 'DELETE',
        },
        {
            isTransformResponse: false,
        });
}
